Notebook: Remove null check after dereference
authorDaniel Boles <dboles@src.gnome.org>
Tue, 1 Aug 2017 18:45:57 +0000 (19:45 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Tue, 1 Aug 2017 19:15:14 +0000 (20:15 +0100)
This function clearly assumes the parameter children cannot be NULL, and
the call sites seem to perform enough checks to confirm this.

CID 1388869 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking children suggests that it may be null,
but it has already been dereferenced on all paths leading to the check.

gtk/gtknotebook.c

index ce55bc5b9e01a021c6233d57abcfe7acd238233c..904dfe77b939c6ed2bab8a285652225a300b4301 100644 (file)
@@ -5167,8 +5167,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook          *notebook,
     }
 
   /* Don't move the current tab past the last position during tabs reordering */
-  if (children &&
-      priv->operation == DRAG_OPERATION_REORDER &&
+  if (priv->operation == DRAG_OPERATION_REORDER &&
       direction == STEP_NEXT)
     {
       switch (tab_pos)